/*
	Copyright 2007-2010 Petr Ohlidal

	This file is a part of GrobMaker

	GrobMaker is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	GrobMaker is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with GrobMaker.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * @file
 * @brief
 */

#ifndef GROBMAKER_EXCEPTION
#define GROBMAKER_EXCEPTION

#include <string>
#include <sstream>
#include <exception>

namespace GrobMaker{

class Exception: public std::exception {
	std::string message;

	public:

	Exception( const std::string& message_)
		:message(message_){}

	virtual	~Exception() throw () {}

	Exception(const char* message){
		this->message = std::string(message);
	}

	Exception(const std::stringstream& message){
		this->message=message.str();
	}

	std::string toString(){
		return this->message;
	}

	const char* what() throw (){
		return this->message.c_str();
	}
};

} // namespace GrobMaker

#endif //#ifndef GROBMAKER_EXCEPTION

